Fractale Tree  0.5
Plot Tree Fractale
qwidget_graphique.cpp
Go to the documentation of this file.
1 #include "qwidget_graphique.h"
2 
3 QWidget_Graphique::QWidget_Graphique(QWidget *parent) : QWidget(parent)
4 {
5 
6 
7  // Init
8  CheckBox_Color= new QCheckBox("Couleur automatique");
9  PushButton_Color = new QPushButton("COLOR");
10  RadioButton_Bout_with = new QRadioButton("Avec bout rond");
11  RadioButton_Bout_with->setChecked(true);
12  RadioButton_Bout_without = new QRadioButton("Sans bout rond");
13 
14  //HBoxLayou_graphique
15  QGridLayout *HBoxLayou_graphique = new QGridLayout;
16  HBoxLayou_graphique->addWidget(CheckBox_Color,1,1);
17  HBoxLayou_graphique->addWidget(PushButton_Color,2,1);
18 
19  HBoxLayou_graphique->addWidget(RadioButton_Bout_with,1,2);
20  HBoxLayou_graphique->addWidget(RadioButton_Bout_without,2,2);
21 
22  // QGroupBox_graphique
23  QGroupBox *QGroupBox_graphique = new QGroupBox(tr("Graphique"));
24  QGroupBox_graphique->setLayout(HBoxLayou_graphique);
25 
26  layout = new QGridLayout();
27  layout->addWidget(QGroupBox_graphique,1,1);
28  this->setLayout(layout);
29 
30  QObject::connect(RadioButton_Bout_with,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
31  QObject::connect(RadioButton_Bout_without,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
32 
33  QObject::connect(CheckBox_Color,SIGNAL(stateChanged(int)),this,SIGNAL(Value_changed()));
34 
35  QObject::connect(PushButton_Color,SIGNAL(clicked(bool)),this,SIGNAL(Value_changed()));
36  QObject::connect(PushButton_Color,SIGNAL(clicked(bool)),this,SLOT(Button_color_clicked()));
37 
38  QObject::connect(this,SIGNAL(Value_changed()),this,SLOT(Update_Etat()));
39 
40  Color.setRgb(254,0,0);
42 }
43 
45 {
46  Color = QColorDialog::getColor(Color, this);
48 }
49 
51 {
52  PushButton_Color->setEnabled(!CheckBox_Color->isChecked());
53 }
54 
55 
56 
58 {
59  return Color;
60 }
61 
62 void QWidget_Graphique::Set_Color(QColor color)
63 {
64  Color=color;
65 
66  QPalette palette;
67  palette.setColor(QPalette::ButtonText, Color);
68  PushButton_Color->setPalette(palette);
69 }
70 
72 {
73  return RadioButton_Bout_with->isChecked();
74 }
75 
77 {
78  RadioButton_Bout_with->setChecked(etat);
79 }
80 
82 {
83  return CheckBox_Color->isChecked();
84 }
85 
87 {
88  CheckBox_Color->setChecked(etat);
89 }
void Set_Color_Auto(bool etat)
QCheckBox * CheckBox_Color
QRadioButton * RadioButton_Bout_without
QPushButton * PushButton_Color
void Set_with_Bout(bool etat)
QRadioButton * RadioButton_Bout_with
QGridLayout * layout
Widget Couleur et Bout de l'abre.
void Set_Color(QColor color)
QWidget_Graphique(QWidget *parent=0)